<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib  prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<c:set var="htmlPath" value="${redis:getSysConfig('in_path_html')}"/>
<c:set var="defaultImg" value="${redis:getSysConfig('website_default_img')}"/>
	<script type="text/javascript">
		//提交
    	function detailInfo(id){
			$.ajax({
			   type: "POST", 
			   dataType: "JSON",
			   url: "${basePath}/back/ordersList/getOrderListObject.sjson",
			   data: {ordersNo:id},
			   success: function(result){
				   var data = JSON.parse(result.data);
				   var ordersDetailList = data.ordersDetailList;
				  var htm = "";
				  htm+="<tr class='titlebg'><td align='center' colspan='13'>订单号:"+data.ordersNo+"<\/td><\/tr>";
				  htm+="<tr><td width='85px' align='center' style='vertical-align:middle;' >商品图片<\/td><td width='120px' align='center' style='vertical-align:middle;' >商品名称<\/td><td width='50px' align='center' style='vertical-align:middle;'>商品编号<\/td><td width='50px' align='center' style='vertical-align:middle;'>市场价<\/td><td width='50px' align='center' style='vertical-align:middle;' >销售价<\/td><td width='50px' align='center' style='vertical-align:middle;'>购买数量<\/td><td width='50px' align='center' style='vertical-align:middle;' >条形码<\/td><td width='60px' align='center' style='vertical-align:middle;' >返利比例(一级)<\/td><td width='60px' align='center' style='vertical-align:middle;' >返利比例(二级)<\/td><td width='60px' align='center' style='vertical-align:middle;' >返利比例(三级)<\/td><td width='60px' align='center' style='vertical-align:middle;' >返利金额(一级)<\/td><td width='60px' align='center' style='vertical-align:middle;' >返利金额(二级)<\/td><td width='60px' align='center' style='vertical-align:middle;' >返利金额(三级)<\/td><\/tr>";
				  for(var i=0;i<ordersDetailList.length;i++){
				      var index=i+1;
				      var upRatio= ordersDetailList[i].upRatio;
				      var secRatio= ordersDetailList[i].secRatio;
				      var thiRatio= ordersDetailList[i].thiRatio;
				      var upRatioAmount= ordersDetailList[i].upRatioAmount;
				      var secRatioAmount= ordersDetailList[i].secRatioAmount;
				      var thiRatioAmount= ordersDetailList[i].thiRatioAmount;
				      if(upRatio=='' || upRatio==undefined){
                          upRatio=0;
                      }
                      if(secRatio=='' || secRatio==undefined){
                          secRatio=0;
                      }
                      if(thiRatio=='' || thiRatio== undefined){
                          thiRatio=0;
                      }
                      if(upRatioAmount==''|| upRatioAmount==undefined){
                          upRatioAmount=0;
                      }
                      if(secRatioAmount=='' || secRatioAmount==undefined){
                          secRatioAmount=0;
                      }
                      if(thiRatioAmount=='' || thiRatioAmount==undefined){
                          thiRatioAmount=0;
                      }
					  htm+="<tr><td align='center' width='150px'> <img id='uploadImg_"+index+1+"' class='uploadImg' onMouseOver='showListBigImage("+index+1+",4,4,0,-40)' onMouseOut='showListRebackImage("+index+1+",1,1)' src='${uploadPath}/"+ordersDetailList[i].logoImage+"' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' width='80px' height='50px' /><\/td><td align='center'style='vertical-align:middle;'>"+ordersDetailList[i].productFullName+"<\/td><td align='center' style='vertical-align:middle;'>"+ordersDetailList[i].productCode+"<\/td><td align='center' style='vertical-align:middle;' >￥"+ordersDetailList[i].marketPrice.toFixed(2)+"<\/td><td align='center' style='vertical-align:middle;'>￥"+ordersDetailList[i].salesPrice.toFixed(2)+"<\/td><td align='center' style='vertical-align:middle;'>"+ordersDetailList[i].count+"<\/td><td align='center' style='vertical-align:middle;' >"+ordersDetailList[i].barCode+"<\/td>"+
					  "<td align='center' width='50px' style='vertical-align:middle;' >"+upRatio+"%"+"<\/td><td align='center' width='50px' style='vertical-align:middle;' >"+secRatio+"%"+"<\/td><td align='center' width='50px' style='vertical-align:middle;' >"+thiRatio+"%"+"<\/td><td align='center' width='50px' style='vertical-align:middle;' >"+upRatioAmount+"元"+"<\/td><td align='center' width='50px' style='vertical-align:middle;' >"+secRatioAmount+" 元"+"<\/td><td align='center' width='50px' style='vertical-align:middle;' >"+thiRatioAmount+" 元"+"<\/td>"
					  +"<\/tr>";
				  }
				  $("#showDetail").html(htm);
			   }
			});
    	}
    </script>
	<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="width:80%">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
					<h5 class="modal-title" id="myModalLabel">订单明细详情</h5>
				</div>
				<div class="modal-body">
					<table align="center" id="showDetail" class="addOrEditTable table table-bordered" style="width:100%;" >
					</table>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
